<html xmlns="http://www.w3.org/1999/xhtml"
      xmlns:h="http://java.sun.com/jsf/html"
      xmlns:ui="http://java.sun.com/jsf/facelets"
      xmlns:p="http://primefaces.org/ui"
      xmlns:f="http://java.sun.com/jsf/core">

    <ui:composition template="layout.xhtml">
        <ui:define name="body">
            <script>
                function title() {
                    document.getElementById('paciente').className='selected';
                }
                window.onload=title;
            </script>
            <h:form id="cepForm" enctype="multipart/form-data">
                <h1 class="title">
                    <a href="#" class="back" onclick="history.go(-1)"/>
                    Paciente
                </h1>
                <p:messages showDetail="true" autoUpdate="true"  /> 
                <div class="row">
                    <div class="twelve columns"> 
                        
                        <fieldset>
                            <legend> <h4 style="margin:0 0 10px 0">Dados Gerais</h4></legend>
                            <p:panel id="customerPrimary" style="background: none; border: none;" 
                                     styleClass="container_24 clearfix ">
                                <p:button icon="ui-icon-search"  title="Visualizar Prontuário" alt="Visualizar Prontuário"
                                  href="showRecords.xhtml?c=#{managerSearchCustomer.customerShow.id}" value="Visualizar Prontuário"
                                  style="margin-top: -80px;" styleClass="right grid_6"/>
                                
                                <div class="clear"></div>
                                
                                <div class="grid_19">
                                    <p:outputLabel for="name" value="Nome :" styleClass="grid_3"/>
                                    <p:inputText id="name" readonly="true" styleClass="grid_20" value="#{managerSearchCustomer.customerShow.name}"/>

                                    <p:outputLabel for="dataNasc" value="Data Nasc :" styleClass="grid_3"/>
                                    <p:inputText id="dataNasc" styleClass="grid_8" readonly="true"
                                                 value="#{managerSearchCustomer.customerShow.dateBirth}">
                                        <f:convertDateTime pattern="dd/MM/yyyy"/>
                                    </p:inputText>

                                    <p:outputLabel for="email" value="E-mail :" styleClass="grid_3" style="margin-left: -3px"/>
                                    <p:inputText id="email" styleClass="grid_8" readonly="true"
                                                 value="#{managerSearchCustomer.customerShow.email}" style="width: 35.5%"/>

                                    <p:outputLabel for="phone" value="Telefone :" styleClass="grid_3"/>
                                    <p:inputMask id="phone" mask="(99) 9999-9999" readonly="true" styleClass="grid_8" value="#{managerSearchCustomer.customerShow.phone}"/>

                                    <p:outputLabel for="cellular" value="Celular :" style="margin-left: -3px" styleClass="grid_3"/>
                                    <p:inputMask id="cellular" mask="(99) 9999-9999" readonly="true"  styleClass="grid_8" style="width: 35.5%" value="#{managerSearchCustomer.customerShow.cellular}"/>

                                    <p:outputLabel value="Estado Civil:"  styleClass="grid_4" style="margin-left: -21px;"/>
                                    <div class="grid_8">
                                        <p:selectOneMenu style="width: 103.5%; height: 21px;" disabled="true" value="#{managerSearchCustomer.customerShow.civilStatus}">  
                                            <f:selectItem itemLabel="" itemValue="" />  
                                            <f:selectItems value="#{managerCustomer.selectCivilStatus()}" />  
                                        </p:selectOneMenu> 
                                    </div>
                                    <p:outputLabel value="Sexo : " styleClass="grid_3"/>
                                    <div class="grid_8">
                                        <p:selectOneMenu style="width: 117.5%; height: 21px;" disabled="true" panelStyle="width:150px;" value="#{managerSearchCustomer.customerShow.gender}" >   
                                            <f:selectItem itemLabel="" itemValue="" />  
                                            <f:selectItems value="#{managerCustomer.gender}" />  
                                        </p:selectOneMenu> 
                                    </div>




                                </div>
                                <div class="grid_5" style="text-align: center;">
                                    <p:panel id="avatar" style="background: none; border: none;" 
                                             styleClass="container_24 clearfix ">
                                        <p:lightBox >
                                            <h:outputLink  
                                                value="#{managerSearchCustomer.annexShow.id eq null ? '':'show/?annex='}#{managerSearchCustomer.annexShow.id eq null ? 'assets/images/avatar.jpg': managerSearchCustomer.annexShow.id}" 
                                                title="#{managerSearchCustomer.customerShow.name}"  target="_blank" >
                                                <p:graphicImage id="avatar1" styleClass="image grid_3" 
                                                                style="width: 150px;" alt="#{managerSearchCustomer.annexShow.id}" title="#{managerSearchCustomer.annexShow.id}"
                                                                url="#{managerSearchCustomer.annexShow.id eq null ? '':'show/?annex='}#{managerSearchCustomer.annexShow.id eq null ? 'assets/images/avatar.jpg': managerSearchCustomer.annexShow.id}" />
                                            </h:outputLink>
                                        </p:lightBox>

                                        <div class="clear"></div>

                                    </p:panel>
                                </div>
                            </p:panel>
                        </fieldset>
                        <fieldset>
                            <legend> <h4 style="margin:0 0 10px 0">Dados Complementares</h4></legend>
                            <p:panel id="customerSecundary" style="background: none; border: none;" 
                                     styleClass="container_24 clearfix ">
                                <p:outputLabel value="CPF:" styleClass="grid_3"/>
                                <p:inputMask mask="999.999.999-99" readonly="true" styleClass="grid_8" value="#{managerSearchCustomer.customerShow.cpf}"/>

                                <p:outputLabel value="RG:" styleClass="grid_4"/>
                                <p:inputText styleClass="grid_8" readonly="true" value="#{managerSearchCustomer.customerShow.rg}"/>

                                <p:outputLabel value="Profissão:" styleClass="grid_3"/>
                                <p:inputText styleClass="grid_20" style="width: 82.3%" readonly="true" value="#{managerSearchCustomer.customerShow.occupation}"/>

                                <p:outputLabel value="Mãe:" styleClass="grid_3"/>
                                <p:inputText styleClass="grid_8" readonly="true" value="#{managerSearchCustomer.customerShow.filiationMother}"/>
                                <p:outputLabel value="Profissão:" styleClass="grid_4"/>
                                <p:inputText styleClass="grid_8" readonly="true" value="#{managerSearchCustomer.customerShow.occupationMother}"/>
                                <div class="clear"/>
                                <p:outputLabel value="Pai:" styleClass="grid_3"/>
                                <p:inputText styleClass="grid_8" readonly="true" value="#{managerSearchCustomer.customerShow.filiationFather}"/>
                                <p:outputLabel value="Profissão:" styleClass="grid_4"/>
                                <p:inputText styleClass="grid_8" readonly="true" value="#{managerSearchCustomer.customerShow.occupationFather}"/>
                                <div class="clear"/>
                                <p:outputLabel value="Responsável:" styleClass="grid_3"/>
                                <p:inputText styleClass="grid_20" style="width: 82.3%" readonly="true" value="#{managerSearchCustomer.customerShow.responsible}"/>

                            </p:panel>
                        </fieldset>
                        <fieldset>
                            <legend> <h4 style="margin:0 0 10px 0">Endereço</h4></legend>
                            <p:panel id="address" style="background: none; border: none;" 
                                     styleClass="container_24 clearfix ">

                                <p:outputLabel value="CEP:" styleClass="grid_3" />
                                <p:inputMask mask="99.999-999" styleClass="grid_8" readonly="true" value="#{managerSearchCustomer.addressShow.zipcode}" />

                                <div class="clear"/>
                                <p:outputLabel value="Logradouro:" styleClass="grid_3" />
                                <p:inputText styleClass="grid_20" style="width: 82.3%" readonly="true" value="#{managerSearchCustomer.addressShow.publicPark}" />
                                <div class="clear"/>
                                <p:outputLabel value="Bairro:" styleClass="grid_3" />
                                <p:inputText  styleClass="grid_8" readonly="true" value="#{managerSearchCustomer.addressShow.neighborhood}" />
                                <p:outputLabel value="Complemento:" styleClass="grid_4" />
                                <p:inputText styleClass="grid_8"  readonly="true" value="#{managerSearchCustomer.addressShow.complement}" />
                                <div class="clear"/>
                                <p:outputLabel value="Nº:" styleClass="grid_3" />
                                <p:inputText styleClass="grid_8" readonly="true" value="#{managerSearchCustomer.addressShow.number}" />
                                <p:outputLabel  value="Cidade:" styleClass="grid_4"  />
                                <p:autoComplete styleClass="grid_7" readonly="true" dropdown="true" converter="#{autocompleteconverter}"   
                                                var="cityValue" style="width: 28.5%" itemLabel="#{cityValue.name.toString().concat(' - ')}#{cityValue.country.sgl}" 
                                                itemValue="#{cityValue}" value="#{managerSearchCustomer.cityShow}"
                                                scrollHeight="200" forceSelection="true"
                                                completeMethod="#{managerCity.autocomplete}" /> 
                            </p:panel>
                        </fieldset>
                        <fieldset>
                            <legend> <h4 style="margin:0 0 10px 0">Plano de Saúde</h4></legend>
                            <p:panel id="customerplain" style="background: none; border: none;" 
                                     styleClass="container_24 clearfix ">
                                <p:outputLabel value="Operadora:" styleClass="grid_3"/>
                                <p:autoComplete value="#{managerSearchCustomer.operatorShow}"  style="width: 79.5%"  readonly="true"
                                                id="operator" completeMethod="#{managerOperator.autocomplete}"  
                                                var="o" itemLabel="#{o.name}" itemValue="#{o}" 
                                                styleClass="grid_19" dropdown="true"
                                                converter="#{autocompleteconverter}" />
                                <div class="clear"/>
                                <p:outputLabel value="Nº Carteirinha:" styleClass="grid_3"/>
                                <p:inputText styleClass="grid_8" readonly="true" value="#{managerSearchCustomer.customerShow.cardNumber}"/>
                                <p:outputLabel value="Validade:" styleClass="grid_4"/>
                                <p:inputText styleClass="grid_8" readonly="true" value="#{managerSearchCustomer.customerShow.validateCard}"/>

                            </p:panel>
                        </fieldset>
                        <div class="buttonAction">
                            <p:button href="searchcustomer.xhtml" value="Voltar"  icon="ui-icon-arrowreturnthick-1-w" />
                        </div >
                    </div>
                </div>
            </h:form>
        </ui:define>
    </ui:composition>

</html>
